//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package cn.net.ecode.modules.sys.utils;

import cn.net.ecode.modules.sys.entity.Role;
import java.util.Iterator;
import java.util.List;

public class RoleUtils {
	public RoleUtils() {
	}

	public static boolean hasCurrentUserRole(String roleCode) {
		return UserUtils.getSubject().hasRole(roleCode);
	}

	/** @deprecated */
	public static boolean containsCurrentUserRole(String roleCode) {
		return hasCurrentUserRole(roleCode);
	}

	public static boolean hasUserRole(String userCode, String roleCode) {
		List<Role> list = UserUtils.get(userCode).getRoleList();
		Iterator var3 = list.iterator();

		Role e;
		do {
			if (!var3.hasNext()) {
				return false;
			}

			e = (Role)var3.next();
		} while(!e.getRoleCode().equals(roleCode));

		return true;
	}

	/** @deprecated */
	public static boolean containsUserRole(String userCode, String roleCode) {
		return hasUserRole(userCode, roleCode);
	}
}
